package factory;

import dao.PetDao;
import dao.impl.PetDaoImpl;
import dao.impl.PetDaoOracleImpl;

public class PetDaoFactory {
    public static String defaultBeanName = "petDaoImpl";

    public static PetDao getInstance(String beanName) {
        PetDao petDao = null;
        switch (beanName) {
            case "petDaoImpl":
                petDao = new PetDaoImpl();
                break;
            case "petDaoOracleImpl":
                petDao = new PetDaoOracleImpl();
                break;
            default:
                throw new RuntimeException("未找到");
        }
        return petDao;
    }
}
